﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace SqlCeDriver
{
	/*
		Class to encapsulate the minumun functionality required for 
		access to a database via the System.Data.SqlServerCe assembly
		as you need different versions for 3.5 and 4.0
	*/
	public abstract class SqlCEDataAccessor
	{
		public abstract DataTable Query(String strConnectionString, String [] commandList, String tableName);
		public abstract int Update(String strConnectionString, String referenceSql, DataTable updatedTable, out String statusMessage);
		public abstract void CreateDatabaseFile(String strConnectionString);
		public abstract void ResetPassword(String oldConnStr, String newConnStr);
		public abstract void UpgradeDatabase(String connStr);
		public abstract void AccessDatabaseEngineType();
		// below here are polluting the interface with special needs methods
		public delegate bool ShowProgressDelegate(int count, int done);
		public abstract void CopyTable(String sourceConnection, String sourceTable, String tgtConnection, String tgtTable, String autoIncField, bool copyContent, ShowProgressDelegate progress);
		// below for importing (version 1).
		public abstract void PopulateTable(String strConnectionString, String tableName, DataTable data, String autoIncField, bool isStaging);
		public abstract void UpdateTable(String strConnectionString, String targetName, String stagingName, String[] pkeys, String[] updateFields);
		// exporting refactor requires this now
		public abstract void ReadInit(String connectionString, String sql);
		public abstract bool ReadNext(out object[] data);
		public abstract void ReadClose();
	}
}
